package com.enation.app.web.tag.navigation;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.enation.app.web.core.model.HomePage;
import com.enation.app.web.core.service.INavigationManager;
import com.enation.framework.taglib.BaseFreeMarkerTag;

import freemarker.template.TemplateModelException;

/**
 * 
 * @function 导航tag
 * @author 闯哥
 * @time 2016年11月15日 下午10:50:56
 */
@Component
public class NavigationTag extends BaseFreeMarkerTag {

	@Autowired
	private INavigationManager navigationManager;

	@Override
	protected Object exec(Map params) throws TemplateModelException {

		String page_name = params.get("page_name").toString();
		HomePage homePage = navigationManager.getHomePage(page_name);
		return homePage;
	}

}
